home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_319 / cnewssrc / uupc.lzh / uupc / ndir.h < prev    next >
C/C++ Source or Header  |  1990-01-16  |  1KB  |  62 lines

  1. /*
  2.  *    ndir.h -- header file for the ``ndir'' directory routines.
  3.  *
  4.  *    $Id: ndir.h,v 1.1 90/01/16 10:24:20 crash Exp Locker: crash $
  5.  */
  6.  
  7. #include <libraries/dos.h>
  8. #ifndef DEV_BSIZE
  9. #  define    DEV_BSIZE    512
  10. #endif
  11. #define DIRBLKSIZ    DEV_BSIZE
  12. #define    MAXNAMLEN    255
  13.  
  14. struct    direct {
  15.     long    d_ino;            /* inode number of entry */
  16.     short    d_reclen;        /* length of this record */ 
  17.     short    d_namlen;        /* length of string in d_name */
  18.     char    d_name[MAXNAMLEN + 1];    /* name must be no longer than this */
  19. };
  20.  
  21. /*
  22.  * The DIRSIZ macro gives the minimum record length which will hold
  23.  * the directory entry.  This requires the amount of space in struct direct
  24.  * without the d_name field, plus enough space for the name with a
  25.  * terminating null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
  26.  */
  27.  
  28. #ifdef DIRSIZ
  29. #  undef DIRSIZ
  30. #endif /* DIRSIZ */
  31.  
  32. #define DIRSIZ(dp) \
  33.     ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
  34.  
  35. /*
  36.  * Definitions for library routines operating on directories.
  37.  */
  38.  
  39. #if 0
  40. typedef struct _dirdesc {
  41.     int    dd_fd;
  42.     long    dd_loc;
  43.     long    dd_size;
  44.     char    dd_buf[DIRBLKSIZ];
  45. } DIR;
  46. #endif
  47.  
  48. typedef struct _dirdesc {
  49.     struct FileLock    *lock;
  50.     struct FileInfoBlock fib;
  51. } DIR;
  52.  
  53. #ifndef NULL
  54. #  define NULL 0L
  55. #endif
  56.  
  57. extern    DIR *opendir();
  58. extern    struct direct *readdir();
  59. extern    void closedir();
  60.  
  61.  
  62.